package addon.w3.mdx.com;

import java.io.IOException;

import addon.w3.mdx.MDXCOM;
import addon.w3.mdx.LEDataInputStream;
import addon.w3.mdx.MDXException;

/**
 * PIVT						// [PivotPoints]
	long	nbytes;
	struct {
		float 	x,y,z
	} pivpts[npvps];
 * @author madjk
 *
 */
public class MDXPivotPointsCOM extends MDXCOM {
	int length;
	public float pos[][] = null;
	
	public String getTag() {
		return "PIVT";
	}
	
	public void _decode(LEDataInputStream ins) throws IOException, MDXException {
		length = ins.readInt();
		pos = new float[length/12][3];
		for(int i=0;i<pos.length;i++) {
			pos[i][0] = ins.readFloat();
			pos[i][1] = ins.readFloat();
			pos[i][2] = ins.readFloat();
		}
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("TAG : "+getTag());
		sb.append("\n\tILEN : "+length);
		sb.append("\n\tPOS[] : "+pos.length );
		return sb.toString();
	}

	@Override
	public boolean isImplicitTag() {
		// TODO Auto-generated method stub
		return true;
	}
}
